package com.lyncs.ods.modules.share.strategy;

import com.alibaba.fastjson.JSONObject;
import com.lyncs.ods.modules.share.model.TxnShareVO;
import com.lyncs.ods.modules.txn.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author alex
 * @date 2022/4/21 22:21
 * @description
 */
@Component("orderStrategy")
public class OrderStrategy extends ShareStrategy {

    @Autowired
    private OrderService orderService;

    @Override
    public Object handle(String data) {
        TxnShareVO txnShareVO = JSONObject.parseObject(data, TxnShareVO.class);
        return orderService.getOrderDetail(txnShareVO.getId());
    }
}
